package com.turing.post.organization.util;

import java.math.BigInteger;
import java.util.List;

import javax.ejb.Local;
import javax.ejb.Remote;

import com.turing.post.util.PCPSApplicationException;
import com.turing.post.util.PCPSWebInput;

/**
 * 商圈业务接口
 * 
 * @author zxp
 * @Dec 18, 2012
 */
@Remote
@Local
public interface BusinessDistrictDao {

	/**
	 * 根据商圈编号查询商圈
	 * 
	 * @param businessDistrictId
	 *            商圈编号
	 * @return BusinessDistrict 商圈
	 */
	public BusinessDistrict getBusinessDistrictByBusinessDistrictId(
			BigInteger businessDistrictId);

	/**
	 * 根据给定的商圈编号获取自身及下级子商圈列表
	 * 
	 * @param businessDistrictId
	 * @return
	 */
	public List<BusinessDistrict> getSelfAllChildBusinessDistrictByBusinessDistrictId(
			BigInteger businessDistrictId);

	/**
	 * 根据发卡商编号查询商圈下拉
	 * 
	 * @param webInput
	 * @return
	 */
	public List<BusinessDistrict> getBusinessDistrictDropdownList(
			PCPSWebInput webInput);

	/**
	 * 商圈总记录数
	 * 
	 * @param webInput
	 *            日志记录对象
	 * @return BigInteger 记录数
	 */
	public BigInteger getBusinessDistrictTotal(PCPSWebInput webInput);

	/**
	 * 分页查询商圈列表
	 * 
	 * 
	 * @param webInput
	 *            日志记录对象
	 * @param page
	 *            页码
	 * @return List 商圈列表
	 */
	public List<BusinessDistrict> getBusinessDistrictList(
			PCPSWebInput webInput, Integer page);

	/**
	 * 新增商圈
	 * 
	 * @param businessDistrict
	 *            商圈
	 * @throws PCPSApplicationException
	 */
	public void insertBusinessDistrict(BusinessDistrict businessDistrict)
			throws PCPSApplicationException;

	/**
	 * 修改商圈
	 * 
	 * @param businessDistrict
	 *            商圈
	 * @throws PCPSApplicationException
	 */
	public void updateBusinessDistrict(BusinessDistrict businessDistrict)
			throws PCPSApplicationException;

	/**
	 * 验证商圈名称重复
	 * 
	 * @param issuecompanyno
	 */
	public Integer IsBusinessDistrictName(String issueCompanyNo,
			String businessDistrictName, BigInteger businessDistrictId);

	/**
	 * 删除商圈
	 * 
	 * @param businessDistrictId
	 * @throws PCPSApplicationException
	 */
	public void deleteBusinessDistrict(BigInteger businessDistrictId)
			throws PCPSApplicationException;

	/**
	 * 检查某商圈是否已经被引用(商圈绑定商户BusinessDistrictMerchant)
	 * 
	 * @return
	 */
	public Integer checkBusinessDistrictMerchant(BigInteger businessDistrictId);

	/**
	 * 检查某商圈是否已经被引用(卡种类绑定商圈CardClassicBindDistrict)
	 * 
	 * @param businessDistrictId
	 * @return
	 */
	public Integer checkBusinessDistrictCardClassic(
			BigInteger businessDistrictId);

	/**
	 * 检查某商圈是否已经被引用(二级商圈)
	 * 
	 * @param businessDistrictId
	 * @return
	 */
	public Integer checkBusinessDistrictChild(BigInteger businessDistrictId);
}
